<?php

class BaseZF_Framework_Log extends Zend_Log
{
    // groups priority
    const DEBUG_GLOBAL = 70;
    const DEBUG_PHP = 71;
    const DEBUG_PDOSTMT = 72;
    const DEBUG_SESSION = 73;
    const DEBUG_APCCACHE = 74;
    const DEBUG_MEMCACHE = 75;

    /**
     * Class constructor.  Create a new logger
     *
     * @param Zend_Log_Writer_Abstract|null  $writer  default writer
     */
    public function __construct($writer = null)
    {
        // Call parent class constructor
        parent::__construct($writer);

        /*
        $old_error_handler = set_error_handler(array("buggy","ErrorHandler"));
		define ("FATAL",E_USER_ERROR);
		define ("WARNING",E_USER_WARNING);
		define ("NOTICE",E_USER_NOTICE);
		// configure reporting level
		error_reporting (FATAL | WARNING | NOTICE);
        */
    }

    public static function getlogGroupNames($id)
    {
        $a = array(
            BaseZF_Framework_Log::DEBUG_GLOBAL      => 'Debug Infos',
            BaseZF_Framework_Log::DEBUG_PHP         => 'PHP Error',
            BaseZF_Framework_Log::DEBUG_SESSION     => 'PHP Session',
            BaseZF_Framework_Log::DEBUG_PDOSTMT     => 'PDO Stmt',
            BaseZF_Framework_Log::DEBUG_APCCACHE    => 'APC Cache',
            BaseZF_Framework_Log::DEBUG_MEMCACHE    => 'MemCache',
        );

        return $a[$id];
    }

    public static function phpErrorHandler($errno, $errstr, $errfile, $errline)
    {

    }
}
